#ifndef LOG_MANAGER_HPP
#define LOG_MANAGER_HPP

#include <string>
#include <map>
#include <fstream>
#include <ctime>
#include <iomanip>
#include <sstream>
#include <filesystem>

class LogManager {
public:
    void init(const std::string& processName);
    void rollLogIfNeeded();

private:
    std::string logDirectory;
    std::map<std::string, std::ofstream> logFiles;
    size_t maxLogSize = 10 * 1024 * 1024; // 10 MB
    std::string currentDate;

    std::string getCurrentDate();
    void openLogFile(const std::string& moduleName);
    void closeLogFile(const std::string& moduleName);
    void rollLogFile(const std::string& moduleName);
};

#endif // LOG_MANAGER_HPP